<template>
  <div id="film">
    <HeadAndContent :list="list"></HeadAndContent>
    <Introduce :list="list" :stars="stars"></Introduce>
  </div>
</template>

<style scoped>

#film {
  color: white;
  background-color: #22496c;
  padding: 0 15px;
}

img {
  width: 90px;
}

</style>

<script>
import { mapState } from 'vuex';
import HeadAndContent from "./HeadAndContentComponent.vue";
import Introduce from "./IntroduceComponent.vue"
export default {
  data() {
    return {
      list:'',
      stars: [],
    };
  },
  components: {
    HeadAndContent,
    Introduce
  },
  computed:{
    ...mapState(['movieId'])
  },
  created() {
    this.getM();
  },
  methods: {
    async getM() {
      await this.axios
        .get(`https://apis.netstart.cn/maoyan/movie/detail?movieId=${this.movieId}`)
        .then((re) => {
          console.log(re);
          this.list = re.movie;
          this.stars = re.celebrities;
        });
    },
  },
};
</script>

